#include<iostream>
#if defined(_WIN32)

#error "Cannot make directory for windows OS."

#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))

#include <sys/stat.h>
#include <sys/types.h>

#else
#error "Cannot make directory for an unknown OS."
#endif

int CreateFile(char* filename){
    //mkdir
    if (mkdir(filename, 0755) == -1) {
        printf("can not make directory, delete directory\n");
        char delete_command[256];
        std::sprintf(delete_command, "rm -rf %s", filename);
        if (system(delete_command) == 1) {
            printf("fail to delete the directory command");
        }
    }
    mkdir(filename, 0755);
    return 0;
}

int main(int argc, char **argv) {
    CreateFile("testFile");
    return 0;
}
